package com.spring.study.config;


import com.spring.study.utils.ResultUtil;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
//全局异常处理器
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public ResultUtil<String> errorHandler(Exception e){
        return ResultUtil.error("500",e.getMessage());
    }
}
